﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;
using System.Data;

namespace PTTPOS_Solution.DAL
{
    public static class Formulas_DA
    {
        public static DataTable ListFormulas = new DataTable();

        public static void GetListFormulas(int id)
        {
            MySqlCommand com = new MySqlCommand("select id_material, Amount, id_unit, id from tblformulas where id_menu=@id", Connection_PTTPOS.GetConnection());
            com.Connection.Open();
            com.Parameters.AddWithValue("@id", id);
            MySqlDataAdapter da = new MySqlDataAdapter(com);
            ListFormulas.Clear();
            da.Fill(ListFormulas);
            com.Connection.Close();
        }
    }
}
